package com.example.demo.controller;


import com.example.demo.pojo.User;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class EndIndexController {



    @RequestMapping("/")
    public String index(HttpServletRequest request){
        User user = (User) request.getSession().getAttribute("user");
        if(user == null){
            return "redirect:/front/login";
        }
        return "/index";
    }

}
